#include "Skan3D.h"
#include <iostream>
using namespace std;

Skan3D::Skan3D(Punkt** aPktT, int aWsz, int aKmn) {
    cout << "Skan3D, aWsz: " << aWsz << ", aKmn: " << aKmn << endl;
    this->maxW = aWsz;
    this->maxK = aKmn;
    this->punkt = aPktT;
    /*
        for (int i = 0; i < 2; i++) {
            for (int j = 0; j < this->maxK; j++) {
                cout <<"["<<i<<";"<<j<<"] "<< this->punkt[i][j].r << " ";
            }
            cout << endl;
        }
     */

} //koniec konstruktora

Skan3D::Skan3D(const Skan3D& s) {
    this->maxK = s.maxK;
    this->maxW = s.maxW;
 /*
  * for (int w = 0; w < this->maxW; w++) {
        for (int k = 0; k < this->maxK; k++) {
            cout << w << ";" << k << "| ";
            cout.flush();
        }
        cout << endl;
        cout.flush();
    }
*/
    this->punkt = new Punkt*[maxW];
    for (int w = 0; w < this->maxW; w++) {
        this->punkt[w] = new Punkt[maxK];
        for (int k = 0; k< this->maxK; k++) {
            this->punkt[w][k] = s.punkt[w][k];
        }
    }

}


Skan3D::Skan3D(int W, int K){
    this->maxK = K;
    this->maxW = W;

    this->punkt = new Punkt*[maxW];
    for (int w = 0; w < this->maxW; w++) {
        this->punkt[w] = new Punkt[maxK];
        for (int k = 0; k< this->maxK; k++) {
            Punkt *p = new Punkt();
            this->punkt[w][k] = *p;
        }
    }


}
